Optimal. Leaf size=39 \[ -\frac {x}{a}-\frac {\tan ^3(x) (1-\csc (x))}{3 a}+\frac {\tan (x) (3-2 \csc (x))}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3888, 3882, 8} \[ -\frac {x}{a}-\frac {\tan ^3(x) (1-\csc (x))}{3 a}+\frac {\tan (x) (3-2 \csc (x))}{3 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3882
Rule 3888
Rubi steps
\begin {align*} \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx &=\frac {\int (-a+a \csc (x)) \tan ^4(x) \, dx}{a^2}\\ &=-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int (3 a-2 a \csc (x)) \tan ^2(x) \, dx}{3 a^2}\\ &=\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int -3 a \, dx}{3 a^2}\\ &=-\frac {x}{a}+\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 62, normalized size = 1.59 \[ -\frac {-2 \sin (x)+4 \cos (2 x)+(6 x-5) (\sin (x)+1) \cos (x)}{6 a \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.73, size = 38, normalized size = 0.97 \[ -\frac {3 \, x \cos \relax (x) + 4 \, \cos \relax (x)^{2} + {\left (3 \, x \cos \relax (x) - 1\right )} \sin \relax (x) - 2}{3 \, {\left (a \cos \relax (x) \sin \relax (x) + a \cos \relax (x)\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.31, size = 49, normalized size = 1.26 \[ -\frac {x}{a} - \frac {1}{2 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) - 1\right )}} - \frac {9 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 24 \, \tan \left (\frac {1}{2} \, x\right ) + 11}{6 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.45, size = 64, normalized size = 1.64 \[ -\frac {1}{2 a \left (\tan \left (\frac {x}{2}\right )-1\right )}+\frac {2}{3 a \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {1}{a \left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {3}{2 a \left (\tan \left (\frac {x}{2}\right )+1\right )}-\frac {2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.42, size = 94, normalized size = 2.41 \[ -\frac {2 \, {\left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - \frac {6 \, \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - \frac {3 \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} + 2\right )}}{3 \, {\left (a + \frac {2 \, a \sin \relax (x)}{\cos \relax (x) + 1} - \frac {2 \, a \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} - \frac {a \sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}}\right )}} - \frac {2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.29, size = 51, normalized size = 1.31 \[ \frac {-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {4}{3}}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^3}-\frac {x}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tan ^{2}{\relax (x )}}{\csc {\relax (x )} + 1}\, dx}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________